class Province:
    def __init__(self, name, population):
        self.name = name
        self.population = population
        self._validate()

    def _validate(self):
        if self.population < 1:
            print("人口必须>=1")
        if type(self.name) is not str:
            print("省份名称必须字符串形式")


test = Province(123, -1)
